package com.jingdianjichi.subject.common.enums;

import lombok.Getter;

/**
 * 分类类型枚举
 *
 * @Author: khj
 * @Date: 2025/3/31
 */
@Getter
public enum CategoryTypeEnum {

    PRIMARY(1, "岗位大类"),
    SECOND(2, "二级分类");

    private int code;

    private String desc;

    CategoryTypeEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static CategoryTypeEnum getByCode(int codeVal) {
        for(CategoryTypeEnum resultCodeEnum : CategoryTypeEnum.values()) {
            if(resultCodeEnum.getCode() == codeVal) {
                return resultCodeEnum;
            }
        }
        return null;
    }
}
